{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 训练LightGBM模型\n",
    "tfidf特征 boosting_type=goss"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import lightgbm as lgb\n",
    "from lightgbm.sklearn import LGBMClassifier\n",
    "from sklearn.model_selection import GridSearchCV"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "准备数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>feat_1_tfidf</th>\n",
       "      <th>feat_2_tfidf</th>\n",
       "      <th>feat_3_tfidf</th>\n",
       "      <th>feat_4_tfidf</th>\n",
       "      <th>feat_5_tfidf</th>\n",
       "      <th>feat_6_tfidf</th>\n",
       "      <th>feat_7_tfidf</th>\n",
       "      <th>feat_8_tfidf</th>\n",
       "      <th>feat_9_tfidf</th>\n",
       "      <th>...</th>\n",
       "      <th>feat_85_tfidf</th>\n",
       "      <th>feat_86_tfidf</th>\n",
       "      <th>feat_87_tfidf</th>\n",
       "      <th>feat_88_tfidf</th>\n",
       "      <th>feat_89_tfidf</th>\n",
       "      <th>feat_90_tfidf</th>\n",
       "      <th>feat_91_tfidf</th>\n",
       "      <th>feat_92_tfidf</th>\n",
       "      <th>feat_93_tfidf</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0.081393</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.075886</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Class_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.231403</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Class_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.199730</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Class_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>0.011987</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.011668</td>\n",
       "      <td>0.105971</td>\n",
       "      <td>0.021681</td>\n",
       "      <td>0.080435</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.008244</td>\n",
       "      <td>0.022456</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Class_1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>...</td>\n",
       "      <td>0.124622</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.145988</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>Class_1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 95 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   id  feat_1_tfidf  feat_2_tfidf  feat_3_tfidf  feat_4_tfidf  feat_5_tfidf  \\\n",
       "0   1      0.081393           0.0           0.0      0.000000      0.000000   \n",
       "1   2      0.000000           0.0           0.0      0.000000      0.000000   \n",
       "2   3      0.000000           0.0           0.0      0.000000      0.000000   \n",
       "3   4      0.011987           0.0           0.0      0.011668      0.105971   \n",
       "4   5      0.000000           0.0           0.0      0.000000      0.000000   \n",
       "\n",
       "   feat_6_tfidf  feat_7_tfidf  feat_8_tfidf  feat_9_tfidf   ...     \\\n",
       "0      0.000000      0.000000      0.000000           0.0   ...      \n",
       "1      0.000000      0.000000      0.231403           0.0   ...      \n",
       "2      0.000000      0.000000      0.199730           0.0   ...      \n",
       "3      0.021681      0.080435      0.000000           0.0   ...      \n",
       "4      0.000000      0.000000      0.000000           0.0   ...      \n",
       "\n",
       "   feat_85_tfidf  feat_86_tfidf  feat_87_tfidf  feat_88_tfidf  feat_89_tfidf  \\\n",
       "0       0.075886       0.000000       0.000000            0.0            0.0   \n",
       "1       0.000000       0.000000       0.000000            0.0            0.0   \n",
       "2       0.000000       0.000000       0.000000            0.0            0.0   \n",
       "3       0.000000       0.008244       0.022456            0.0            0.0   \n",
       "4       0.124622       0.000000       0.000000            0.0            0.0   \n",
       "\n",
       "   feat_90_tfidf  feat_91_tfidf  feat_92_tfidf  feat_93_tfidf   target  \n",
       "0       0.000000            0.0            0.0            0.0  Class_1  \n",
       "1       0.000000            0.0            0.0            0.0  Class_1  \n",
       "2       0.000000            0.0            0.0            0.0  Class_1  \n",
       "3       0.000000            0.0            0.0            0.0  Class_1  \n",
       "4       0.145988            0.0            0.0            0.0  Class_1  \n",
       "\n",
       "[5 rows x 95 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dpath = \"../data/\"\n",
    "train = pd.read_csv(dpath + \"Otto_FE_train_tfidf.csv\")\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = train.iloc[:,1:94]\n",
    "y = train[\"target\"]\n",
    "y = y.map(lambda x:int(x[6:])-1)\n",
    "feat_names = X.columns\n",
    "from scipy.sparse import csr_matrix\n",
    "X = csr_matrix(X)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((61878, 93), (61878,))"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "X.shape, y.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "LightGBM超参数调优"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import StratifiedKFold\n",
    "kfold = StratifiedKFold(n_splits=3,shuffle=True,random_state=6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "1.n_estimators"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "max_rounds = 10000\n",
    "def get_n_estimators(params, X, y, early_stopping_rounds=10):\n",
    "    lgbm_train = lgb.Dataset(X,y)\n",
    "    cv_results = lgb.cv(params = params,train_set=lgbm_train,num_boost_round=max_rounds,nfold=3,\\\n",
    "                        metrics=\"multi_logloss\",early_stopping_rounds=early_stopping_rounds,seed=6)\n",
    "    print(\"best_estimators:\",len(cv_results[\"multi_logloss-mean\"]))\n",
    "    print(\"best_score:\", cv_results[\"multi_logloss-mean\"][-1])\n",
    "    return len(cv_results[\"multi_logloss-mean\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best_estimators: 266\n",
      "best_score: 0.49721154780182303\n"
     ]
    }
   ],
   "source": [
    "params = {'boosting_type': 'goss',\n",
    "          'objective': 'multiclass',\n",
    "          'num_class':9,\n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'num_leaves': 70,\n",
    "          'max_depth': 7,\n",
    "          'max_bin': 127, \n",
    "          'colsample_bytree': 0.7,\n",
    "         }\n",
    "n_estimators = get_n_estimators(params,X,y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "2.num_leaves & max_depth"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 3 folds for each of 4 candidates, totalling 12 fits\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=4)]: Using backend LokyBackend with 4 concurrent workers.\n",
      "[Parallel(n_jobs=4)]: Done   8 out of  12 | elapsed:  2.5min remaining:  1.2min\n",
      "[Parallel(n_jobs=4)]: Done  12 out of  12 | elapsed:  3.6min finished\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=StratifiedKFold(n_splits=3, random_state=6, shuffle=True),\n",
       "       error_score='raise-deprecating',\n",
       "       estimator=LGBMClassifier(boosting_type='goss', class_weight=None, colsample_bytree=0.7,\n",
       "        importance_type='split', learning_rate=0.1, max_bin=127,\n",
       "        max_depth=7, min_child_samples=20, min_child_weight=0.001,\n",
       "        min_split_gain=0.0, n_estimators=266, n_jobs=4, num_class=9,\n",
       "        num_leaves=31, objective='multiclass', random_state=None,\n",
       "        reg_alpha=0.0, reg_lambda=0.0, silent=False, subsample=1.0,\n",
       "        subsample_for_bin=200000, subsample_freq=0),\n",
       "       fit_params=None, iid='warn', n_jobs=4,\n",
       "       param_grid={'num_leaves': range(50, 90, 10)},\n",
       "       pre_dispatch='2*n_jobs', refit=False, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=5)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "params = {'boosting_type': 'goss',\n",
    "          'objective': 'multiclass',\n",
    "          'num_class':9, \n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'n_estimators':n_estimators,\n",
    "          'max_depth': 7,\n",
    "          'max_bin': 127, \n",
    "          'colsample_bytree': 0.7,\n",
    "         }\n",
    "lgbm = LGBMClassifier(silent=False,**params)\n",
    "num_leaves = range(50,90,10)\n",
    "param_grid = dict(num_leaves=num_leaves)\n",
    "gridsearch = GridSearchCV(lgbm,n_jobs=4,param_grid=param_grid,cv=kfold,\\\n",
    "                    scoring=\"neg_log_loss\",verbose=5,refit=False)\n",
    "gridsearch.fit(X,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.4970997679302036\n",
      "{'num_leaves': 70}\n"
     ]
    }
   ],
   "source": [
    "print(gridsearch.best_score_)\n",
    "print(gridsearch.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAELCAYAAAALC/uGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl4VOXd//H3NxshMbIYQAhLUBKWgopGBDdUDCK14laV1rVW6k/cwAXbPu31PNpNinu1Fi3qo09d2qqlallEERRRAgqo7BAEVBbZw5Lt+/tjBgwxkARycjKTz+u6cs3Mmfuc+d4ewyf3OWfuY+6OiIhIEBLCLkBEROKXQkZERAKjkBERkcAoZEREJDAKGRERCYxCRkREAqOQERGRwChkREQkMAoZEREJTFLYBYQtMzPTs7Ozwy5DRCSmzJ49e4O7t6quXaMPmezsbAoKCsIuQ0QkppjZypq00+EyEREJjEJGREQCo5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b4kui6nfFdhvP2L1d+V/gMuAUuBj4KdEzsG8CLSMLrvC3XfX6ecqZEREJCg6XCYiIoFRyIiISGAUMiIiEhiFjIiIBEYhIyIigVHIiIhIYBQyIg2MmT1jZpdU31Kk4VPIiIhIYBQyIjVgZtnRG4k9Gb3x0yQza2pmU80sL9omM3qvHszsGjN7zcz+bWYrzOwmMxsZnWF5ppm1rOHnnmBm70ZnzJ5YYe6v681slpnNNbN/RqcLaWaRG9IlRNukmdkqM0s2s6PNbEJ0O9PNrFu0zQ+jN7Gaa2bTAvmPJ42aQkak5nKAx9z9e8Bm4OJq2vcEfkRkAsXfAjuiMyx/AFxV3YeZWTLwKHCJu58AjItuByI3mjrR3Y8FFgDXRac9mQv0j7b5ATAxOiHiWODm6HbuAB6Ptvk1cE50O+dXV5NIbSVV30REola4+yfR57OB7Grav+Pu24BtZrYF+Hd0+XzgmBp8XlciQTU5MqchiUSmlgfoaWa/AZoDhwETo8tfIjI/1TtE7oHyuJkdRmTG3b9HtwPQJPr4PvBM9E6Jr9SgJpFaUciI1FzFiQPLgKZEJhvcc0Qg9QDtyyu8Lqdmv3sGfObu/ap47xngAnefa2bXAGdEl48Hfh89HHcC8DaRe4dsdvfjKm/E3W8ws5OA7wOfmNlx7v5NDWoTqREdLhM5NIVE/jGHb6dMryuLgFZm1g8ih8/M7HvR9zKAr6KH1H68ZwV33w58BDwMvB6978lWYIWZ/TC6HTOzY6PPj3b3D93918AGoEMd90EaOYWMyKEZA/w/M5sBZNblht29mEhw3Wdmc4FPiBz2AvgV8CEwGVhYadWXgCuij3v8GLguup3PiNwlEeCPZjbfzD4FphE5pyNSZzTVv4iIBEYjGRERCYxO/IuExMweA06ptPhhd386jHpEgqDDZSIiEhgdLhMRkcAoZEREJDAKGRERCYxCRkREAqOQERGRwPx/rgJ0ngIMzHEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_means = gridsearch.cv_results_[\"mean_test_score\"]\n",
    "plt.plot(num_leaves,-test_means)\n",
    "plt.xlabel(\"num_leaves\")\n",
    "plt.ylabel(\"log_loss\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "3.min_child_samples"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 3 folds for each of 5 candidates, totalling 15 fits\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=4)]: Using backend LokyBackend with 4 concurrent workers.\n",
      "[Parallel(n_jobs=4)]: Done  12 out of  15 | elapsed:  4.1min remaining:  1.0min\n",
      "[Parallel(n_jobs=4)]: Done  15 out of  15 | elapsed:  5.0min finished\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=StratifiedKFold(n_splits=3, random_state=6, shuffle=True),\n",
       "       error_score='raise-deprecating',\n",
       "       estimator=LGBMClassifier(boosting_type='goss', class_weight=None, colsample_bytree=0.7,\n",
       "        importance_type='split', learning_rate=0.1, max_bin=127,\n",
       "        max_depth=7, min_child_samples=20, min_child_weight=0.001,\n",
       "        min_split_gain=0.0, n_estimators=266, n_jobs=4, num_class=9,\n",
       "        num_leaves=70, objective='multiclass', random_state=None,\n",
       "        reg_alpha=0.0, reg_lambda=0.0, silent=False, subsample=1.0,\n",
       "        subsample_for_bin=200000, subsample_freq=0),\n",
       "       fit_params=None, iid='warn', n_jobs=4,\n",
       "       param_grid={'min_child_samples': range(10, 60, 10)},\n",
       "       pre_dispatch='2*n_jobs', refit=False, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=5)"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "params = {'boosting_type': 'goss',\n",
    "          'objective': 'multiclass',\n",
    "          'num_class':9, \n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'n_estimators':n_estimators,\n",
    "          'max_depth': 7,\n",
    "          'num_leaves':70,\n",
    "          'max_bin': 127, \n",
    "          'colsample_bytree': 0.7,\n",
    "         }\n",
    "lgbm = LGBMClassifier(silent=False,**params)\n",
    "min_child_samples = range(10,60,10)\n",
    "param_grid = dict(min_child_samples=min_child_samples)\n",
    "gridsearch = GridSearchCV(lgbm,n_jobs=4,param_grid=param_grid,cv=kfold,\\\n",
    "                    scoring=\"neg_log_loss\",verbose=5,refit=False)\n",
    "gridsearch.fit(X,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.4970997679302036\n",
      "{'min_child_samples': 20}\n"
     ]
    }
   ],
   "source": [
    "print(gridsearch.best_score_)\n",
    "print(gridsearch.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAELCAYAAAALC/uGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xl8FfW9//HXJwlh3xMQSCSsIrJzWFyKK61LC1pZ3HfttXq11rba273219va61V7r7etImhdAVdE616LK3DYNwVEkE0IO4IsIZ/fHzPBIwaSQCZzkryfj8d5JGfOzDmfmZC8me/MfMbcHRERkShkxF2AiIjUXAoZERGJjEJGREQio5AREZHIKGRERCQyChkREYmMQkZERCKjkBERkcgoZEREJDJZcRcQt5ycHC8oKIi7DBGRamXGjBkb3D23rPlqfcgUFBSQTCbjLkNEpFoxsxXlmU/DZSIiEhmFjIiIREYhIyIikVHIiIhIZBQy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ubqdu/dw954EDSBFAIWM1B6fuPs8D7osLyC4G6AT9JMqKGX+59y92N0XAq0P8b5nAOPcfSeAu6feQK6k8/SMg3xGqhMJ+tBB0EftUKYDV5rZr4GeHtx8DWCUmc0k6DV2HNA9ZZmSocB5wFR33+7uhcCukgaYwDR3X+bu+8JaTjrgc08H+gPTLbi/zOkEPbGWAR3N7H/M7EwgbW7pIPFTyEhtsTvl++KU58WUfmwydf7S7lOS+trBGgCWvMe+g3zGgcrVSNCDu6EOAVYDj5jZZWbWgWCv7HR37wW8CNQrpZbUdS95XlLbgZ9/4HMDHvYvbyF8jLv/2t03E+xRvQXcQPW4I6RUEYWMyJF5FbjKzBoAmFmLw3yfdwlaw0MwBHVQZtae4MZYDxDctqAf0ATYAWw1s9YEN6aqqIHhsaEMgmGxdw54/Q1ghJm1CutoYWbtwzPPMtz9aeAXYT0igM4uEzki7v6ymfUBkma2B3iJ0o/xlOVm4HEzu5nghmqHcgrwYzPbC3wOXObun5jZLIKhwGUEoVVR7xMcf+oJTCG4sdV+7r7QzH5OcAvfDILbS9wAfAGMSzlR4KeH8dlSQ6nVv4hgZqcAP3L3b8ddi9QsGi4TEZHIaE9GpBzMrCdfP+trt7sPqkmfKVLZFDIiIhIZDZeJiEhkFDIiIhIZhYyIiERGISMiIpFRyIiISGT+P7pRTJ48vIWgAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_means = gridsearch.cv_results_[\"mean_test_score\"]\n",
    "plt.plot(min_child_samples,-test_means)\n",
    "plt.xlabel(\"min_child_samples\")\n",
    "plt.ylabel(\"log_loss\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "4.列采样参数colsample_bytree/sub_feature/feature_fraction"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 3 folds for each of 5 candidates, totalling 15 fits\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=4)]: Using backend LokyBackend with 4 concurrent workers.\n",
      "[Parallel(n_jobs=4)]: Done  12 out of  15 | elapsed:  4.2min remaining:  1.1min\n",
      "[Parallel(n_jobs=4)]: Done  15 out of  15 | elapsed:  5.2min finished\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=StratifiedKFold(n_splits=3, random_state=6, shuffle=True),\n",
       "       error_score='raise-deprecating',\n",
       "       estimator=LGBMClassifier(boosting_type='goss', class_weight=None, colsample_bytree=1.0,\n",
       "        importance_type='split', learning_rate=0.1, max_bin=127,\n",
       "        max_depth=7, min_child_samples=20, min_child_weight=0.001,\n",
       "        min_split_gain=0.0, n_estimators=266, n_jobs=4, num_class=9,\n",
       "        num_leaves=70, objective='multiclass', random_state=None,\n",
       "        reg_alpha=0.0, reg_lambda=0.0, silent=False, subsample=1.0,\n",
       "        subsample_for_bin=200000, subsample_freq=0),\n",
       "       fit_params=None, iid='warn', n_jobs=4,\n",
       "       param_grid={'colsample_bytree': [0.4, 0.5, 0.6, 0.7, 0.8]},\n",
       "       pre_dispatch='2*n_jobs', refit=False, return_train_score='warn',\n",
       "       scoring='neg_log_loss', verbose=5)"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "params = {'boosting_type': 'goss',\n",
    "          'objective': 'multiclass',\n",
    "          'num_class':9, \n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.1,\n",
    "          'n_estimators':n_estimators,\n",
    "          'max_depth': 7,\n",
    "          'num_leaves':70,\n",
    "          'min_child_samples':20,\n",
    "          'max_bin': 127, \n",
    "         }\n",
    "lgbm = LGBMClassifier(silent = False,**params)\n",
    "colsample_bytree = [i/10 for i in range(4,9)]\n",
    "param_grid = dict(colsample_bytree=colsample_bytree)\n",
    "gridsearch = GridSearchCV(lgbm,n_jobs=4,param_grid=param_grid,cv=kfold,\\\n",
    "                    scoring=\"neg_log_loss\",verbose=5,refit=False)\n",
    "gridsearch.fit(X,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "-0.4970997679302036\n",
      "{'colsample_bytree': 0.7}\n"
     ]
    }
   ],
   "source": [
    "print(gridsearch.best_score_)\n",
    "print(gridsearch.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAEMCAYAAAAWDss+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvOIA7rQAAIABJREFUeJzt3Xt8VfWZ7/HPkyskhAAh4ZJsCCiK4S47Vq11bBXrpQUvSHA6Vltbz/TUcU7buTinM3Ns+5ppa0+P7TnjmXNswXF6pgW8o7XFarUtUpWAAiIiyMUElDvIPSR5zh9rBTcxkASysvZOvu/Xa7+y1m//fns9a4t5sm6/x9wdERGRKGTFHYCIiPRcSjIiIhIZJRkREYmMkoyIiERGSUZERCKjJCMiIpGJPMmY2VVmttbM1pvZ3afoN9PM3MyS4XqemT1oZqvMbIWZXZbSt8bMVprZajO7N6X9NjPbYWavh68vRbpzIiJySpEmGTPLBu4HrgaqgJvNrKqNfkXAXcArKc1fBnD3CcA04IdmlmVmJcAPgMvdfRwwxMwuTxk3390nh6+fRrJjIiLSIVEfyVwArHf3De7eAMwDZrTR7zvAvcCRlLYq4HkAd98O7AWSwGjgbXffEfZ7DrgxmvBFRORMRJ1kyoG6lPX6sO04M5sCJNz96VZjVwAzzCzHzEYBU4EEsB4Ya2a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7dfHaOv9awmONqYD/2Bm4wgqkL7g7tebWSXBkUmLoynLzSnrzZz4/13rbbVezwIuSvnF356Tfd7PgM8RTDn/xVOMP5iybMBfuPui1A4W1H3/rrv/3w7GJL2YrslIb/M8MMvMSgDC6yNLCH75QvCLeHHqgLAYXMLdXwD+BhhA8Nd7MUHJBGi7UFxH1ITbuATY5+77Wr3/LHBnSiyT2/m8GWbWJ9y/y4ClYfu/Af8FwN1Xh237CU7pncwi4Ctmlhtu+xwzKwzbv2hm/cL28vAoSeQjdCQjvYq7rzazfwJ+Z2ZNBKd87gLmmtlfAzuAL7Qalg38PzMrJvjr/j5332tm9xKcLvs6J5bV7Yw9ZraE4PpOW0cYdwH3m9lKgv9ffw/8+Sk+71XglwTXb77jHxbG2mZma/jwVB8EpQ3uNrPXCUoetPZToBJYbsG5tR3Ade7+rJmdB/wxPOV2APgzYHvHdll6E031LxITM3uR4MaC2m7YVgHB9aDz2zhaEomMTpeJ9HBmdgXwFvC/lGCku+lIRiTDmNkXgL9s1fySu381jnhETkVJRkREIqPTZSIiEhklGRERiYySjIiIREZJRkREIqMkIyIikfn/kRHRQoYD0mYAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_means = gridsearch.cv_results_[\"mean_test_score\"]\n",
    "plt.plot(colsample_bytree,-test_means)\n",
    "plt.xlabel(\"colsample_bytree\")\n",
    "plt.ylabel(\"log_loss\")\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "6.减小学习率，调整n_estimators"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "best_estimators: 2827\n",
      "best_score: 0.48339023966100164\n"
     ]
    }
   ],
   "source": [
    "#用之前学习的参数重新调整n_estimators\n",
    "params = {'boosting_type': 'goss',\n",
    "          'objective': 'multiclass',\n",
    "          'num_class':9, \n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.01,\n",
    "          #'n_estimators':n_estimators,\n",
    "          'max_depth': 7,\n",
    "          'num_leaves':70,\n",
    "          'min_child_samples':20,\n",
    "          'max_bin': 127, \n",
    "          'colsample_bytree': 0.7,\n",
    "         }\n",
    "n_estimators_2 = get_n_estimators(params , X , y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LGBMClassifier(boosting_type='goss', class_weight=None, colsample_bytree=0.7,\n",
       "        importance_type='split', learning_rate=0.01, max_bin=127,\n",
       "        max_depth=7, min_child_samples=20, min_child_weight=0.001,\n",
       "        min_split_gain=0.0, n_estimators=2827, n_jobs=4, num_class=9,\n",
       "        num_leaves=75, objective='multiclass', random_state=None,\n",
       "        reg_alpha=0.0, reg_lambda=0.0, silent=False, subsample=1.0,\n",
       "        subsample_for_bin=200000, subsample_freq=0)"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "params = {'boosting_type': 'goss',\n",
    "          'objective': 'multiclass',\n",
    "          'num_class':9, \n",
    "          'n_jobs': 4,\n",
    "          'learning_rate': 0.01,\n",
    "          'n_estimators':n_estimators_2,\n",
    "          'max_depth': 7,\n",
    "          'num_leaves':75,\n",
    "          'min_child_samples':20,\n",
    "          'max_bin': 127, \n",
    "          'colsample_bytree': 0.7,\n",
    "         }\n",
    "\n",
    "lgbm = LGBMClassifier(silent=False,  **params)\n",
    "lgbm.fit(X, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "特征重要度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "feture_importance = pd.DataFrame({\"columns\":list(feat_names,),\"importance\":lgbm.feature_importances_.T})\n",
    "feature_importance = feture_importance.sort_values(by=[\"importance\"],ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>columns</th>\n",
       "      <th>importance</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>feat_67_tfidf</td>\n",
       "      <td>46344</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>feat_25_tfidf</td>\n",
       "      <td>45471</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>feat_24_tfidf</td>\n",
       "      <td>43096</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>47</th>\n",
       "      <td>feat_48_tfidf</td>\n",
       "      <td>40567</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>feat_86_tfidf</td>\n",
       "      <td>36742</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39</th>\n",
       "      <td>feat_40_tfidf</td>\n",
       "      <td>36520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>feat_14_tfidf</td>\n",
       "      <td>32311</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>61</th>\n",
       "      <td>feat_62_tfidf</td>\n",
       "      <td>28275</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>feat_16_tfidf</td>\n",
       "      <td>26491</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>feat_64_tfidf</td>\n",
       "      <td>25726</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>feat_42_tfidf</td>\n",
       "      <td>24547</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>33</th>\n",
       "      <td>feat_34_tfidf</td>\n",
       "      <td>23634</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>feat_88_tfidf</td>\n",
       "      <td>23601</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>32</th>\n",
       "      <td>feat_33_tfidf</td>\n",
       "      <td>23599</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>feat_15_tfidf</td>\n",
       "      <td>22462</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>53</th>\n",
       "      <td>feat_54_tfidf</td>\n",
       "      <td>21707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>69</th>\n",
       "      <td>feat_70_tfidf</td>\n",
       "      <td>20610</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>feat_8_tfidf</td>\n",
       "      <td>19582</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>31</th>\n",
       "      <td>feat_32_tfidf</td>\n",
       "      <td>19541</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>59</th>\n",
       "      <td>feat_60_tfidf</td>\n",
       "      <td>18371</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>feat_72_tfidf</td>\n",
       "      <td>17813</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>feat_43_tfidf</td>\n",
       "      <td>16996</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>35</th>\n",
       "      <td>feat_36_tfidf</td>\n",
       "      <td>16630</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>feat_71_tfidf</td>\n",
       "      <td>16105</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>feat_9_tfidf</td>\n",
       "      <td>15615</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>feat_66_tfidf</td>\n",
       "      <td>15578</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>feat_85_tfidf</td>\n",
       "      <td>15510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>feat_22_tfidf</td>\n",
       "      <td>15302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>feat_92_tfidf</td>\n",
       "      <td>15291</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>feat_18_tfidf</td>\n",
       "      <td>14274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>feat_90_tfidf</td>\n",
       "      <td>7205</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>feat_29_tfidf</td>\n",
       "      <td>7004</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>feat_78_tfidf</td>\n",
       "      <td>6774</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>feat_3_tfidf</td>\n",
       "      <td>6704</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>feat_91_tfidf</td>\n",
       "      <td>6340</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>48</th>\n",
       "      <td>feat_49_tfidf</td>\n",
       "      <td>6228</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>57</th>\n",
       "      <td>feat_58_tfidf</td>\n",
       "      <td>5952</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>feat_30_tfidf</td>\n",
       "      <td>5917</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>feat_46_tfidf</td>\n",
       "      <td>5629</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>feat_27_tfidf</td>\n",
       "      <td>5313</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>feat_12_tfidf</td>\n",
       "      <td>5214</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>feat_21_tfidf</td>\n",
       "      <td>5093</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>feat_7_tfidf</td>\n",
       "      <td>4984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>feat_63_tfidf</td>\n",
       "      <td>4887</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>feat_23_tfidf</td>\n",
       "      <td>4689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>feat_77_tfidf</td>\n",
       "      <td>4485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>feat_45_tfidf</td>\n",
       "      <td>4398</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>feat_28_tfidf</td>\n",
       "      <td>4334</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>feat_5_tfidf</td>\n",
       "      <td>4254</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>51</th>\n",
       "      <td>feat_52_tfidf</td>\n",
       "      <td>4246</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>feat_19_tfidf</td>\n",
       "      <td>4112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>feat_81_tfidf</td>\n",
       "      <td>3902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>feat_93_tfidf</td>\n",
       "      <td>3798</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>feat_2_tfidf</td>\n",
       "      <td>3372</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>30</th>\n",
       "      <td>feat_31_tfidf</td>\n",
       "      <td>3012</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>feat_82_tfidf</td>\n",
       "      <td>2093</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>60</th>\n",
       "      <td>feat_61_tfidf</td>\n",
       "      <td>1892</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>feat_84_tfidf</td>\n",
       "      <td>1696</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>feat_6_tfidf</td>\n",
       "      <td>1540</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50</th>\n",
       "      <td>feat_51_tfidf</td>\n",
       "      <td>1054</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>93 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          columns  importance\n",
       "66  feat_67_tfidf       46344\n",
       "24  feat_25_tfidf       45471\n",
       "23  feat_24_tfidf       43096\n",
       "47  feat_48_tfidf       40567\n",
       "85  feat_86_tfidf       36742\n",
       "39  feat_40_tfidf       36520\n",
       "13  feat_14_tfidf       32311\n",
       "61  feat_62_tfidf       28275\n",
       "15  feat_16_tfidf       26491\n",
       "63  feat_64_tfidf       25726\n",
       "41  feat_42_tfidf       24547\n",
       "33  feat_34_tfidf       23634\n",
       "87  feat_88_tfidf       23601\n",
       "32  feat_33_tfidf       23599\n",
       "14  feat_15_tfidf       22462\n",
       "53  feat_54_tfidf       21707\n",
       "69  feat_70_tfidf       20610\n",
       "7    feat_8_tfidf       19582\n",
       "31  feat_32_tfidf       19541\n",
       "59  feat_60_tfidf       18371\n",
       "71  feat_72_tfidf       17813\n",
       "42  feat_43_tfidf       16996\n",
       "35  feat_36_tfidf       16630\n",
       "70  feat_71_tfidf       16105\n",
       "8    feat_9_tfidf       15615\n",
       "65  feat_66_tfidf       15578\n",
       "84  feat_85_tfidf       15510\n",
       "21  feat_22_tfidf       15302\n",
       "91  feat_92_tfidf       15291\n",
       "17  feat_18_tfidf       14274\n",
       "..            ...         ...\n",
       "89  feat_90_tfidf        7205\n",
       "28  feat_29_tfidf        7004\n",
       "77  feat_78_tfidf        6774\n",
       "2    feat_3_tfidf        6704\n",
       "90  feat_91_tfidf        6340\n",
       "48  feat_49_tfidf        6228\n",
       "57  feat_58_tfidf        5952\n",
       "29  feat_30_tfidf        5917\n",
       "45  feat_46_tfidf        5629\n",
       "26  feat_27_tfidf        5313\n",
       "11  feat_12_tfidf        5214\n",
       "20  feat_21_tfidf        5093\n",
       "6    feat_7_tfidf        4984\n",
       "62  feat_63_tfidf        4887\n",
       "22  feat_23_tfidf        4689\n",
       "76  feat_77_tfidf        4485\n",
       "44  feat_45_tfidf        4398\n",
       "27  feat_28_tfidf        4334\n",
       "4    feat_5_tfidf        4254\n",
       "51  feat_52_tfidf        4246\n",
       "18  feat_19_tfidf        4112\n",
       "80  feat_81_tfidf        3902\n",
       "92  feat_93_tfidf        3798\n",
       "1    feat_2_tfidf        3372\n",
       "30  feat_31_tfidf        3012\n",
       "81  feat_82_tfidf        2093\n",
       "60  feat_61_tfidf        1892\n",
       "83  feat_84_tfidf        1696\n",
       "5    feat_6_tfidf        1540\n",
       "50  feat_51_tfidf        1054\n",
       "\n",
       "[93 rows x 2 columns]"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "feature_importance"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "保存模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pickle\n",
    "pickle.dump(lgbm,open(\"otto_lgbmgoss_tfidf.pkl\",\"wb\"))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
